package cn.webrx.wxs.mapper;

import cn.webrx.wxs.entity.Supplier;
import cn.webrx.wxs.vo.VoSupplier;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface SupplierMapper {

    List<Supplier> selectAll(String keyword);

    @Insert("insert into ws_supplier(name,tel,contact,remark,address) values(#{name},#{tel},#{contact},#{remark},#{address})")
    int save(VoSupplier vs);

    @Delete("delete from ws_supplier where id = #{id}")
    int delById(int id);

    @Select("select name,tel,contact,remark,address from ws_supplier where id = #{id}")
    VoSupplier queryById(int id);

    @Update("update ws_supplier set name=#{name},tel=#{tel},remark=#{remark},contact=#{contact},address=#{address} where id=#{id}")
    int update(Map<String,Object> map);

}